package homework2;

import java.io.BufferedReader;

import java.io.InputStreamReader;

public class Factors {

	public static void main(String args[]){
	
        BufferedReader buffer = new BufferedReader(new InputStreamReader(System.in));
        
        String strLine = null;

        try
        {
              
           while( (strLine = buffer.readLine()) != null){
        	   
              if(strLine.equals("0")){
            	  
            	  System.out.println("Goodbye");
            	  
            	  break;
            	  
              }
              
              System.out.print(Integer.parseInt(strLine) + " = ");
              
              factoring(Integer.parseInt(strLine));
              
           }
          
           buffer.close();                    
                                      
        }
        
        catch(Exception e){
        	
           System.out.println("Error while reading line from console : " + e);
           
        }
        
	}
	
	public static void factoring(int n){
		
		for (int i = 1 ; i <= n ; i++){
			
			if (n%i==0 && i !=1){
				
				System.out.print(i);
				
				if(i != n){
				
					System.out.print(" * ");
					
					factoring(n/i);
					
				}else{
			
					System.out.println();
				}
				
				break;
				
			}
				
		}
	
	}
	
}
